home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 34.zip
/
BS1 part 34
/
FredFish PD 308.adf
/
StarBlanker
/
src
/
Mess.mod
< prev
next >
Wrap
Text File
|
1990-01-18
|
2KB
|
74 lines
IMPLEMENTATION MODULE Mess;
FROM DOSProcess IMPORT Delay;
FROM RunTime IMPORT GfxBase;
FROM GfxBase IMPORT GfxBaseRecPtr;
FROM SYSTEM IMPORT ADR, BYTE;
FROM Pens IMPORT RectFill, Move, SetAPen, SetBPen;
FROM Text IMPORT Text;
FROM Intuition IMPORT OpenWindow, WBenchScreen, WindowFlagSet,
WindowFlags, IDCMPFlagSet, CloseWindow,
NewWindow, WindowPtr, SmartRefresh;
(*$S-*)
PROCEDURE LengthStr(str:ARRAY OF CHAR): CARDINAL;
VAR
i : INTEGER;
BEGIN
i:=-1;
REPEAT
INC(i);
UNTIL (str[i]=0C) OR (i>INTEGER(HIGH(str)));
RETURN i;
END LengthStr;
(*$S-*)
PROCEDURE SayMessage(text : ARRAY OF CHAR);
VAR NWindow : NewWindow;
wp : WindowPtr;
gb : GfxBaseRecPtr;
width : CARDINAL;
left : CARDINAL;
len : CARDINAL;
BEGIN
len := LengthStr(text);
gb := GfxBase;
width := len * 8 + 8;
left := (CARDINAL(gb^.NormalDisplayColumns) - width) DIV 2;
WITH NWindow DO
LeftEdge := left; TopEdge := 30;
Width := width; Height := 13;
BlockPen := BYTE (0); DetailPen := BYTE (0);
Title := NIL;
Flags := WindowFlagSet {Borderless,NoCareRefresh}+SmartRefresh;
IDCMPFlags := IDCMPFlagSet{};
CheckMark := NIL;
FirstGadget := NIL;
CheckMark := NIL; Screen := NIL;
Type := WBenchScreen; BitMap := NIL;
MinWidth := -1; MinHeight := -1;
MaxWidth := -1; MaxHeight := -1;
END;
(* Open the window *)
wp := OpenWindow(ADR(NWindow));
IF wp # NIL THEN
SetBPen(wp^.RPort,1);
SetAPen(wp^.RPort,2);
RectFill(wp^.RPort,0,0,wp^.Width-1,wp^.Height-1);
SetAPen(wp^.RPort,1);
RectFill(wp^.RPort,2,1,wp^.Width-3,wp^.Height-2);
Move(wp^.RPort,5,9);
SetAPen(wp^.RPort,0);
Text(wp^.RPort,ADR(text),len);
Delay(80);
CloseWindow(wp);
END;
END SayMessage;
END Mess.